/** "Standard" Types 
  Written in the D programming language 1.0

Authors:	Wei Li <oldrev@gmail.com>
License:	BSD
Copyright:	Copyright (C) 2007 Wei Li. All rights reserved.
Date:		May 2007
*/

module dotmars.base.stdtypes;


///////////////////// Interfaces ////////////////////////

/**
  A IDisposable interface is used to represent a non-memory resource

*/
interface IDisposable
{
	/**
	  Release the non-memory resource
	*/
	void close();
}

/**

*/
interface ICloneable
{
	Object clone();
}

/**
*/
template Sink(T)
{
	alias void delegate(T) Sink;
}

/**
*/
template Emitter(T)
{
	alias T delegate() Emitter;
}


version(DigitalMars) {
	alias void* Argument;
}
else
{
	alias char* Argument;
}


interface IFormatProvider
{
	Object getFormat(TypeInfo type);
}


interface ICustomFormatter
{
	void format(Sink!(char) sink, char[] fmtstr, 
			Argument arg, TypeInfo type, IFormatProvider provider);
}


interface IFormattable
{
	void getChars(Sink!(char) sink, char[] fmtstr, IFormatProvider provider);
}
